#import "CuriousEchoesController.h"
        
#import "CuriousEchoesModel.h"
#import "CuriousEchoesCell.h"
#import "Masonry.h"

@interface CuriousEchoesController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *keyholeZestTableView;
@property (nonatomic, strong) NSMutableArray *hopeDatas;

@end

@implementation CuriousEchoesController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self embarkSetupui];
	[self opusYearningZealotfetchData];
}


//: 获取数据模型
- (void)opusYearningZealotfetchData {
	
}

- (UITableView *)figHandleTableView {
    if (!_keyholeZestTableView) {
        _keyholeZestTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _keyholeZestTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _keyholeZestTableView.estimatedRowHeight = 0;
        _keyholeZestTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _keyholeZestTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _keyholeZestTableView.delegate = self;
        _keyholeZestTableView.dataSource = self;
        _keyholeZestTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _keyholeZestTableView.showsVerticalScrollIndicator = NO;
        _keyholeZestTableView.showsHorizontalScrollIndicator = NO;
        _keyholeZestTableView.backgroundColor = UIColor.clearColor;
    }
    return _keyholeZestTableView;
}

//: 懒加载数据模型数组
- (NSMutableArray *)hopeDatas {
	if (!_hopeDatas) {
		_hopeDatas = [NSMutableArray array];
	}
	return _hopeDatas;
}

//: 初始化页面UI
- (void)embarkSetupui {

	[self.view addSubview:self.keyholeZestTableView];
	[self.keyholeZestTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.hopeDatas.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    CuriousEchoesCell *zenith = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([CuriousEchoesCell class])];
    if (zenith == nil) {
        zenith = [[CuriousEchoesCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([CuriousEchoesCell class])];
    }
    zenith.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return zenith;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
